BackColor Property

Returns/sets the background color of the Treeview control.

Syntax

object.BackColor [=value]

The BackColor property syntax has these parts:

Part Description
object Required. An object expression that evaluates to an object in the Applies To list.
value A value or constant that determines the background mode, as described in Settings. 

Settings

The cTreeView wrapper uses the Microsoft Windows operating environment red-green-blue (RGB) color scheme. The settings for value are:

Constant Description
Normal RGB colors Colors specified by using the Color palette or by using the RGB or QBColor functions in code.
System default colors Colors specified by system color constants listed in the Visual Basic (VB)object library in theObject Browser. The Windows operating environment substitutes the user's choices as specified in theControl Panel settings.

Remarks

The BackColor will not affect the TreeView control until object.BackMode = vbColor. (Default = vbWindowBackground)

The valid range for a normal RGB color is 0 to 16,777,215 (&HFFFFFF). The high byte of a number in this range equals 0; the lower 3 bytes, from least to most significant byte, determine the amount of red, green, and blue, respectively. The red, green, and blue components are each represented by a number between 0 and 255 (&HFF). If the high byte isn't 0, Visual Basic uses the system colors, as defined in the user'sControl Panel settings and by constants listed in the Visual Basic (VB)object library in theObject Browser.

Data Type

OLE_COLOR 

Example

 

'
'## Note: oTree is a reference to the vbTree.cTreeView class
'
'## Set Background color to ToolTip BackColor
'
With oTree
    .Backmode = bmColor
    .BackColor = vbInfoBackground
End With